﻿using System.Windows.Forms;

partial class OracleConnectionStringEditor : UserControl
{
    public OracleConnectionStringEditor()
    {
        InitializeComponent();
    }

    public OracleConnectionStringEditor(string connectionString)
    {
        InitializeComponent();

        OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(connectionString);

        tbTns.Text = builder.Source;
        tbUid.Text = builder.Id;
        tbPwd.Text = builder.Password;
    }

    public override string ToString()
    {
        // http://www.connectionstrings.com/oracle
        return string.Format("Data Source={0};User Id={1};Password={2};",
            tbTns.Text,
            tbUid.Text,
            tbPwd.Text);
    }
}